<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>List sản phẩm dạng cột div</title>


<link href="style/cs1.css" rel="stylesheet" type="text/css" />
<link href="style/tooltips.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.js"></script>

</head>

<body>
<?php
$idhang = $_GET["idhang"];
include("config/config.php");
$lenh = "select hinh, tenlaptop,tenhanglaptop,tenloai,concat(soluong,' Cái')as soluong,concat(format(dongia,0),' VNĐ')as dongia,malaptop from laptop,hanglaptop,loailaptop where laptop.mahanglaptop = hanglaptop.mahanglaptop and laptop.maloailaptop=loailaptop.maloailaptop and laptop.mahanglaptop='$idhang'";
$kq = mysql_query($lenh);

$sodong = 12;
$sodulieu = mysql_num_rows($kq);
$sotrang = ceil($sodulieu/$sodong);
if(!$_GET["p"])
$p = 1;
else
$p = $_GET["p"];
$x = ($p-1)*$sodong;
$lenh1 = "select hinh,left(tenlaptop,30) as tenlaptop,tenhanglaptop,tenloai,concat(soluong,' Cái')as soluong,concat(format(dongia,0),' VNĐ')as dongia,malaptop,mota from laptop,hanglaptop,loailaptop where laptop.mahanglaptop = hanglaptop.mahanglaptop and laptop.maloailaptop=loailaptop.maloailaptop and laptop.mahanglaptop='$idhang' limit $x,$sodong";
$kq1 = mysql_query($lenh1);

?>
<div id="rowcha">
<div id="dhtmltooltip"></div>
<script type="text/javascript" src="js/tooltips.js"></script>

<?php
 while($row = mysql_fetch_array($kq1))
  {
	  ?>
	<div class="rowcon">
   <font color="#000000" style="padding-left:10px;"> Tên laptop:</font> <a onmouseout="hideddrivetip()" onmouseover="ddrivetip('<?php  echo $row[6];  ?>', 'lightyellow', 500)" href="#" > 	<?php echo $row[1];?></a>
  <br />
<span style="display:none" id="select_text_<?php  echo $row[6];  ?>"><?php  echo  $row[7];?></span>
<span style="display:none" id="select_image_<?php  echo $row[6];  ?>"><?php echo  $row[0];?></span>
   
  <!-- <font color="#000000" style="padding-left:10px;">Số lượng:</font>  <?php echo $row[4];       ?><br/>-->
   <font color="#000000" style="padding-left:10px;">Hãng laptop:</font>  <?php echo $row[2];       ?><br/>
   <font color="#000000" style="padding-left:10px;">Đơn giá:</font> <?php echo $row[5];       ?><br/>
   <img src="laptop/<?php echo $row[0];       ?>" width="150" height="100" class="hinhsphang"/><br/>
   <div class="xemchitiet"><a href="index.php?idlaptop=<?php echo $row[6];   ?>">Xem chi tiêt >></a>
   <a href="index.php?act=gh&Malaptop=<?php  echo $row[6];    ?>"><img src="image/dathang.gif" width="103" height="30" border="0" /></a>
   </div>
    
    </div><!--rowcon-->
<?php
  }
  ?>
</div><!--rowcha-->
<p align="center" style="clear:both">
<?php
for($i = 1; $i <= $sotrang; $i++)
{
	if($p==$i)
	{
		echo "&nbsp;".$i."&nbsp;";
	}
	else
	{
		?>
    <a href="index.php?idhang=<?php echo $idhang;  ?>&p=<?php  echo $i;   ?>"><?php  echo $i;  ?></a>
    <?php
	}		
}
?>
</p>
</body>
</html>